package com.example.therDays.ui.components.dailyWeather

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Icon
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowRight
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.Role.Companion.Image
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.therDays.R
import com.example.therDays.ui.model.entity.DailyWeatherModel


@Composable
fun DailyWeatherItem(dailyWeather : DailyWeatherModel) {
    Row(modifier = Modifier
        .fillMaxWidth()
        .height(90.dp)
        .padding(4.dp)
        .clip(RoundedCornerShape(12.dp))
        .background(color = Color(0xFFD2DFFF))
        .padding(horizontal = 6.dp),
        verticalAlignment = Alignment.CenterVertically,
        horizontalArrangement = Arrangement.SpaceBetween
    ) {
        Box(){
            Row(
                verticalAlignment = Alignment.CenterVertically,
                horizontalArrangement = Arrangement.SpaceAround,
                modifier = Modifier.fillMaxWidth(0.4f)
            ) {
                Image(painter = painterResource(id = R.drawable.group48), contentDescription = null)
                Column(
                    modifier = Modifier.fillMaxHeight(),
                    verticalArrangement = Arrangement.Center
                ) {
                    Text(text = "星期四" ,style = TextStyle(
                            fontSize = 16.sp
                            ))
                    Text(text = "07/20",style = TextStyle(
                        fontSize = 16.sp
                    ))
                }
            }
        }
        Box(){
            Row(
                verticalAlignment =Alignment.CenterVertically ,
                horizontalArrangement = Arrangement.SpaceAround,
                modifier = Modifier.fillMaxWidth(0.4f)
            ) {
                Text(text = "30°C", style = TextStyle(
                    fontSize = 18.sp
                )
                )
                Icon(imageVector = Icons.Default.KeyboardArrowRight,
                    contentDescription =null,
                    modifier = Modifier.size(24.dp)
                )
            }
        }
    }
}


